<?php


namespace App\HttpController;


use EasySwoole\Http\AbstractInterface\AbstractRouter;
use EasySwoole\Http\Request;
use EasySwoole\Http\Response;
use FastRoute\RouteCollector;

class Router extends AbstractRouter
{
    function initialize(RouteCollector $routeCollector)
    {
        /**
         * API
         */
        $routeCollector->addGroup('/api/v1', function (\FastRoute\RouteCollector $collector) {
            $collector->get('/ip', 'Tools/ip'); //ip查询
            $collector->get('/fanyi', 'Tools/fanyi'); //在线翻译
            $collector->get('/pinyin', 'Tools/pinyin'); //汉字转拼音
            $collector->get('/dateCalculation', 'Tools/dateCalculation'); //日期间隔计算器
            $collector->get('/rmb', 'Tools/rmb'); //RMB转换
            $collector->get('/dictionary', 'Tools/dictionary'); //新华字典
            $collector->get('/school', 'Tools/school'); //高校查询
            $collector->get('/qrcode', 'Tools/qrcode'); //二维码生成
            $collector->get('/phoneArea', 'Tools/phoneArea'); //号码归属地查询
            $collector->get('/login', 'User/login'); //微信登录
            $collector->get('/info', 'UserInfo/info'); //获取个人信息
            $collector->get('/user_edit', 'UserInfo/user_edit'); //用户编辑
            $collector->get('/detail', 'ToolsCommon/detail'); //工具详情
            $collector->get('/lists', 'ToolsCommon/lists'); //工具列表
            $collector->post('/file', 'UserInfo/file'); //上传
        });
    }
}